import { httpGet, handleResult } from "./http";

//列表
export async function list() {
  const url = "/module/list";
  return await httpGet(url).then(res => res.data.data);
}
//树列表
export async function treeList() {
  const url = "/module/list/tree";
  return await httpGet(url).then(res => res.data.data);
}
//新增
export async function save({ id, moduleName, url, pid }) {
  const params = { id, moduleName, url, pid };
  url = "/module/save";
  return await httpGet(url, params).then(handleResult);
}
//删除
export async function delete1(id) {
  const url = "/module/delete";
  return await httpGet(url, { id }).then(handleResult);
}
